<taglib name='Message' />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
	<head>
		<meta http-equiv="content-type" content="text/html; charset=utf-8">
		<title>注册</title>
		<load href="__PUBLIC__/Css/basic.css" />
		<load href="__PUBLIC__/Css/Admin/reg.css" />
		<load href="__PUBLIC__/Js/jquery.js"/>
		<script>
			$(function(){
				var error=new Array();
				$('input[name="username"]').blur(function(){
					var username=$(this).val();
					$.get('__URL__/checkName',{'username':username},function(data){
						if(data=='不允许'){
							error['username']=1;
							$('input[name="username"]').after('<p id="umessage" style="color:red">该用户名已经注册</p>');
						}else{
							error['username']=0;
							$('#umessage').remove();
						}
					});
				});

				//提交表单
				$('img.register').click(function(){
					if(error['username']==1){
						return false;
					}else{
						$('form[name="myForm"]').submit();
					}
				});
			});
		</script>
	</head>
	<body>
		<form action='__URL__/doReg' method='post' name='myForm'>
			用 户 名：<input type='text' name='username'/><br/>
			密　　码：<input type='password' name='password'/><br/>
			确认密码：<input type='password' name='repassword'/><br/>
			性　　别：<input type='radio' name='sex' value='1' class='radio'/>男
			      <input type='radio' name='sex' value='0' class='radio'/>女<br/>
			验 证 码：<input type='text' name='code'/>
					  <Message:code width='30' height='30' />	  
				      <br/>
			<img src='__PUBLIC__/Images/register.gif' class='register'/>
			<img src='__PUBLIC__/Images/reset.gif' class='reset'/>
		</form>
	</body>
</html>

